/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.meteocal.managers;

import org.meteocal.entities.User;

/**
 *
 * @author Luigi
 */
public class LoginManager {
   private User currentUser=null;
   private String username=null;
   private String password=null;
   
   //THE LOGIN SHOULD ALSO START THE NOTIFICATION CHECK
   
   //THE USER SHOULD BE CHECKED FROM THE DB
   public void buildUser(String username, String password){
       this.currentUser = new User(username, password);
   }

   
   
    /**
     * @return the currentUser
     */
    public User getCurrentUser() {
        return currentUser;
    }

    /**
     * @param currentUser the currentUser to set
     */
    public void setCurrentUser(User currentUser) {
        this.currentUser = currentUser;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username) {
        this.username = username;
        if (password!=null) buildUser(username,password);
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
        if (username!=null) buildUser(username,password);
    }
    
}
